﻿<html DIR="LTR" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
  <head>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8" />
    <META NAME="save" CONTENT="history" />
    <title>Using Statements with SQL</title>
    
    <link rel="stylesheet" type="text/css" href="../local/Classic.css">
      
    </link>
    
    <script src="../local/script.js">
      
    </script><script src="../local/script_main.js">&amp;nbsp;</script>
  </head>
  <body>
    <!--Topic built:03/26/2010 02:49:39-->

    
    
    
    
    
    
    
    
    
    <div id="header">
      <table width="100%" id="topTable"><tr>
          <td align="left">
            <span id="headerBold">Using Statements with SQL</span>
          </td>
          <td align="right">
            
          </td>
        </tr></table>
      
      
      
    </div>
    <div id="mainSection">
      
        
        
    <font color="DarkGray">
      
    </font>
    <p />
    
    <p />
  
        <div id="introductionSection" class="section">
    <p>When you work with data in a SQL Server database by using the Microsoft SQL Server JDBC Driver and inline SQL statements, there are different classes that you can use. Which class you use depends on the type of SQL statement that you want to run. </p>
    <p>If your SQL statement contains no IN parameters, use the <a href="ec24963c-8b51-4838-91e9-1fbfa2347451.htm">SQLServerStatement</a> class, but if it does contain IN parameters, use the <a href="a8481c06-fbba-432b-8c69-4f4619c20ad4.htm">SQLServerPreparedStatement</a> class. </p>
    <div style="margin: .5em 1.5em .5em 1.5em"><b>Note: </b>
      If you need to use SQL statements that contain both IN and OUT parameters, you must implement them as stored procedures and call them by using the <a href="30710a63-c05d-47d9-9cf9-c087a1c76373.htm">SQLServerCallableStatement</a> class. For more information about using stored procedures, see <a href="0041f9e1-09b6-4487-b052-afd636c8e89a.htm">Using Statements with Stored Procedures</a>.<p />
    </div>
    <p>The following sections describe the different scenarios for working with data in a SQL Server database by using SQL statements.</p>
  </div><h1 class="heading">In This Section</h1><div id="inThisSectionSection" class="section">
    <content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
      <table width="100%" cellspacing="0" cellpadding="0" border="1" style="background-color: #CCCCCC;" xmlns=""><tr>
            <th>
              Topic
            </th>
            <th>
              Description
            </th>
          </tr><tr>
          <td>
            <p>
              <a href="4b0728bd-059b-4b71-895c-999335bc7427.htm">Using an SQL Statement with No Parameters</a>
            </p>
          </td>
          <td>
            <p>Describes how to use SQL statements that contain no parameters.</p>
          </td>
        </tr><tr>
          <td>
            <p>
              <a href="3202b88f-ce13-44dd-982c-c6a3b0260378.htm">Using an SQL Statement with Parameters</a>
            </p>
          </td>
          <td>
            <p>Describes how to use SQL statements that contain parameters.</p>
          </td>
        </tr><tr>
          <td>
            <p>
              <a href="f49ea499-df3c-4e85-9fc7-450fb99622a6.htm">Using an SQL Statement to Modify Database Objects</a>
            </p>
          </td>
          <td>
            <p>Describes how to use SQL statements to modify database objects.</p>
          </td>
        </tr><tr>
          <td>
            <p>
              <a href="4704199b-c0ae-4c77-8a2e-6963715b4ffb.htm">Using an SQL Statement to Modify Data</a>
            </p>
          </td>
          <td>
            <p>Describes how to use SQL statements to modify data in a database.</p>
          </td>
        </tr></table>
    </content>
  </div><span id="seeAlsoSpan"><h1 class="heading">See Also</h1></span><div id="seeAlsoSection" class="section" name="collapseableSection"><a href="7f8f3e8f-841e-4449-9154-b5366870121f.htm">Using Statements with the JDBC Driver</a><br /><br /></div><!--[if gte IE 5]>
			<tool:tip element="seeAlsoToolTip" avoidmouse="false"/><tool:tip element="languageFilterToolTip" avoidmouse="false"/><tool:tip element="roleInfoSpan" avoidmouse="false"/>
		<![endif]-->
      <div id="footer" class="section">
        
		<hr />
		
		<span id="fb" class="feedbackcss">
			
			
		</span>
		
		<a href="9bad553b-9e70-4696-8499-2e35f772a1e0.htm">
			
			© 2010 Microsoft Corporation. All rights reserved.
		</a>
 	
	
      </div>
    </div>
  </body>
</html>